import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:namewava/utils/jc_image_path.dart';
import 'package:namewava/utils/jc_text_style.dart';

class JcDiceNormal extends StatelessWidget {
  const JcDiceNormal({super.key, required this.diceTap});
  final Function diceTap;

  @override
  Widget build(BuildContext context) {
    double diceW = 54.w;
    double left = 0.5 * (336.w - 54.w);
    return Column(children: [
      Stack(
        children: [
          Container(
            // margin: EdgeInsets.only(left: 30.w,right: 30.w),
            width: 336.w,
            height: 241.h,
            padding: EdgeInsets.only(
              left: 15.w,
              right: 15.w,
              top: 24.h,
            ),
            decoration: const BoxDecoration(
                image: DecorationImage(
                    image: AssetImage(JcImagePath.jcDiceResBg),
                    fit: BoxFit.fill)),
            child: Column(
              children: [
                _titleWidget(),
                SizedBox(
                  height: 5.h,
                ),
                _contentWidget()
              ],
            ),
          ),
          Positioned(
              left: left,
              bottom: 0,
              child: InkWell(
                child: Container(
                  width: diceW,
                  height: diceW,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(54.w * 0.5)),
                  child: Image.asset(
                    JcImagePath.jcDiceStepIcon,
                    width: 32.w,
                    height: 37.w,
                  ),
                ),
                onTap: () {
                  diceTap();
                },
              ))
        ],
      ),
      SizedBox(
        height: 200.h,
      )
    ]);
  }

  _titleWidget() {
    return Text(
      'Hey everyone， \nwelcome to NameWave！',
      textAlign: TextAlign.center,
      style: JcTextStyle.poetsenOneRegularTextStyle(24.sp, Colors.white),
    );
  }

  _contentWidget() {
    return Text(
      'To find a funny screen name,\n fill out a few trivia questions and\n we‘ll generate one for you',
      textAlign: TextAlign.center,
      style: JcTextStyle.poetsenOneRegularTextStyle(
          14.sp, const Color.fromRGBO(255, 255, 255, 0.7)),
    );
  }
}
